package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the CTLDEFAULT database table.
 * 
 */
@Embeddable
public class CtldefaultPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String controllerclass;
	private String style;
	private String statecode;

    public CtldefaultPK() {
    }

	@Column(unique=true, nullable=false, length=128)
	public String getControllerclass() {
		return this.controllerclass;
	}
	public void setControllerclass(String controllerclass) {
		this.controllerclass = controllerclass;
	}

	@Column(unique=true, nullable=false, length=20)
	public String getStyle() {
		return this.style;
	}
	public void setStyle(String style) {
		this.style = style;
	}

	@Column(unique=true, nullable=false, length=40)
	public String getStatecode() {
		return this.statecode;
	}
	public void setStatecode(String statecode) {
		this.statecode = statecode;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof CtldefaultPK)) {
			return false;
		}
		CtldefaultPK castOther = (CtldefaultPK)other;
		return 
			this.controllerclass.equals(castOther.controllerclass)
			&& this.style.equals(castOther.style)
			&& this.statecode.equals(castOther.statecode);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.controllerclass.hashCode();
		hash = hash * prime + this.style.hashCode();
		hash = hash * prime + this.statecode.hashCode();
		
		return hash;
    }
}